//
//  XJBrokenLineView.h
//  Demo-折线王者
//
//  Created by Silent on 14/10/28.
//  Copyright (c) 2014年 MLF.YiLiao. All rights reserved.
//

#import <UIKit/UIKit.h>
@class XJGraphLine,XJBrokenLineView;
/** 代理方法 */
@protocol XJBrokenLineViewDelegate <NSObject>
@optional
/** 原点坐标的位置 */
- (CGPoint)brokenLineViewWithoriginPoint:(XJBrokenLineView *)brokenLineView;

/** y轴的分割值的间隔 */
- (int)brokenLineViewWithNumberOfHorizontal:(XJBrokenLineView *)brokenLineView;

/** y轴线的间隔 */
- (float)brokenLineViewWithIntervalForyAxisLine:(XJBrokenLineView *)brokenLineView;
/**
 *  当前选中高亮的按钮
 *
 *  @param button    按钮
 */
- (void)brokenLineView:(XJBrokenLineView *)brokenLineView didSelectBtnAtNow:(UIButton *)button;

@end

/** 数据源方法 */
@protocol XJBrokenLineViewDataSource <NSObject>
@required
/**
 *  折线的个数
 *
 *  @param brokenLineView 绘制的视图
 *
 *  @return 个数
 */
- (int)numberOfLineInBrokenLineView:(XJBrokenLineView *)brokenLineView;
/**
 *  折线的属性
 *
 *  @param brokenLineView 绘制的视图
 *  @param number         折线对应的下标
 *
 *  @return 折线的属性
 */
- (XJGraphLine *)brokenLineView:(XJBrokenLineView *)brokenLineView withNumberForLine:(int)number;
/**
 *  返回横坐标的数值 注意x轴多一个O
 *
 *  @param brokenLineView 绘制的视图
 *
 *  @return 横坐标的数值
 */
- (NSArray *)brokenLineViewWithXAxisValues:(XJBrokenLineView *)brokenLineView ;

@end
@interface XJBrokenLineView : UIView


@property (weak, nonatomic) id<XJBrokenLineViewDelegate> delegate;

@property (weak, nonatomic) id<XJBrokenLineViewDataSource> dataSource;

@property (assign, nonatomic) CGFloat standardLineWidth;
/**
 *  消除一条线
 *
 *  @param graphLine 线属性
 */
- (void)removeLineWithGraphLine:(XJGraphLine *)graphLine;

/**
 *  开始划线，数据发生改变的时候一定要记得重新划线,注意就是该方法是在drawRect方法前调用的
 */
- (void)startDrawLine;

@end
